SRC=sys_util.c deamon_util.c getline.c watchworker.c
OBJ=sys_util.o deamon_util.o getline.o watchworker.o

default:libcomm.a demo

libcomm.a: $(OBJ)
	ar -ru $(PROJECT_L_DIR)/libcomm.a $(OBJ)
	cp *.h $(PROJECT_H_DIR)/

sys_util.o:sys_util.c sys_util.h
	cc -g -w -c sys_util.c

deamon_util.o:deamon_util.c deamon_util.h
	cc -g -w -c deamon_util.c

getline.o:getline.c getline.h
	cc -g -w -c getline.c

watchworker.o:watchworker.c watchworker.h
	cc -g -w -c watchworker.c

demo:demo.c
	cc -g -o demo demo.c -L$(PROJECT_L_DIR) -lcomm

clean:
	rm -f *.o $(PROJECT_L_DIR)/libcomm.a ./demo
	rm -f $(PROJECT_H_DIR)/sys_util.h $(PROJECT_H_DIR)/deamon_util.h $(PROJECT_H_DIR)/getline.h $(PROJECT_H_DIR)/watchworker.h
